home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
tchk050.arc
/
DATEHK.H
< prev
next >
Wrap
C/C++ Source or Header
|
1988-11-19
|
2KB
|
34 lines
/* TCHK 0.50 - Howard Kapustein's Turbo C library 11-18-87 */
/* Copyright (C) 1987, Howard Kapustein. All rights reserved. */
/* datehk.h - header file for DATEHK.C - date routines */
#include <howard.h>
#ifndef BASE_LEAP_YEAR
typedef enum { Sun, Mon, Tues, Wed, Thrus, Fri, Sat } days;
typedef enum { Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec } months;
typedef struct ddate {
int dyear; /* Year - 1900 */
int dday; /* Day of month (1-31) */
months dmon; /* Month (Jan = 0) */
};
#define DATENULL " - - "
#define DATECHAR '-'
#define DATECHARSTR "-"
#define BASE_LEAP_YEAR 1980
#endif
/* function prototypes */
boolean valid_date(int month, int day, int yearnum); /* check if a date is valid */
boolean isleapyear(int checkyear); /* is checkyear a leap year */
struct ddate *strtoddate(char *source); /* convert a string to struct */
char *ddatetostr(struct ddate *source); /* convert struct to a string */
char *ddatetolong(struct ddate *source); /* convert struct to a full english string */
char *ddatetoshort(struct ddate *source); /* convert struct to a short english string */
char *monthexpand(int month); /* convert # to month name */
int dayofyear(struct ddate *d); /* calc day # of year (1-365) */
int daysleft(struct ddate *d); /* calc # days left in year (0-365) */
long int diffddate(struct ddate *start, struct ddate *fini); /* calc fini - start, in days */